<?php

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;
use App\Services\Alibaba\Ali;
class GreenContent implements Rule
{

    /**
     * Determine if the validation rule passes.
     *
     * @param  string  $attribute
     * @param  mixed  $value
     * @return bool
     */
    public function passes($attribute, $value)
    {
        return app(Ali::class)->green($value);
    }

    /**
     * Get the validation error message.
     *
     * @return string
     */
    public function message()
    {
        return '您提交的内容包含非法信息';
    }
}
